home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: miker3@ix.netcom.com (Mike Rubenstein)
- Newsgroups: comp.lang.c
- Subject: Re: Is this ok: *pointer++ = value ??
- Date: Mon, 08 Jan 1996 01:15:08 GMT
- Organization: Netcom
- Message-ID: <30f07002.168040256@nntp.ix.netcom.com>
- References: <4cklvv$nmm@alcor.usc.edu> <4cmmcd$e3u@gryphon.phoenix.net> <30eefb76.72646976@nntp.ix.netcom.com> <4cn97v$6on@fountain.mindlink.net>
- NNTP-Posting-Host: ix-dc14-09.ix.netcom.com
- X-NETCOM-Date: Sun Jan 07 5:14:50 PM PST 1996
- X-Newsreader: Forte Agent .99c/16.141
-
- genew@mindlink.bc.ca (Gene Wirchenko) wrote:
-
- |>miker3@ix.netcom.com (Mike Rubenstein) wrote:
- |>
- |>>brucew@phoenix.net (Bruce Wedding) wrote:
- |>
- |>>|>wawda@alcor.usc.edu (Abu Wawda) wrote:
- |>>|>
- |>>|>> for (i=0; i<50; i++) *pointer++ = i;
- |>>|>
- |>>|>>My only problem is why? I mean you aren't allowed to do:
- |>>|>
- |>>|>> for (i=0; i<50; i++) p++ = i;
- |>>|>
- |>>|>Sure you can do that. You are assigning addresses to the
- pointer.
- |>>It
- |>>|>probably isn't too smart, but it is legal.
- |>
- |>>In what language is it legal? Certainly not C which requires a
- |>>modifiable lvalue as the right operand of = and defines p++ as not
- |>>being an lvalue.
- |>
- |>>Michael M Rubenstein
- |>
- |> Bull! The RIGHT operand requires an L-value? Ha! That would
- |>make:
- |> int a;
- |> a=2;
- |>illegal.
- |> In the example above,
- |> p
- |>is the L-value. After being used as such, it is incremented.
- |>
- |>Sincerely,
- |>
- |>Gene Wirchenko
- |>
- |>C Pronunciation Guide:
- |> y=x++; "wye equals ex plus plus semicolon"
- |> x=x++; "ex equals ex doublecross semicolon"
- |>
-
-
- I was, of course, talking about Gimel, the Hebrew version of C :-)
-
- Guess I still haven't learned to tell my left from my right. I meant
- the left operand.
-
-
- Michael M Rubenstein
-